package com.sdi.columbus;

import android.app.Activity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TableLayout;
import android.widget.TextView;

public class DisplayAsset extends Activity {

	Intent in;
	Bundle b;
	int id;
	String vid;
	GpsData gets=new GpsData();
	String model,op,phn;
	String yom,make,reg;
	TextView t1,t2,t3,t4,t5;
	String[] VehicleNames=new String[gets.getSize()];
//	String[] VehicleYOMs=new String[gets.getSize()];
	String[] VehicleMake=new String[gets.getSize()];
	String[] VehicleRegNo=new String[gets.getSize()];
//	int [] VehicleIds=new int[gets.getSize()];
	String[] VehicleIds=new String[gets.getSize()];
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.display_asset);
		//setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		TableLayout tableLayout=(TableLayout)findViewById(R.id.tbll);
		ImageView imageView =(ImageView)findViewById(R.id.imageView1);
	
      
		
		in=getIntent();
		b=in.getExtras(); 
		id=b.getInt("argid");
		System.out.println("just reached display asset n argid"+id);
		
		
		VehicleNames=gets.getVehicleModel();
//		VehicleYOMs=gets.getVehicleYOM();
		VehicleMake=gets.getVehicleMake();
		VehicleRegNo=gets.getVehicleRegNo();
		VehicleIds=gets.getVehicleIds();
    	
		
		
		model=VehicleNames[id];
//		yom=VehicleYOMs[id];
		make=VehicleMake[id];
		reg=VehicleRegNo[id];
//		vid=VehicleIds[id];
		vid=VehicleIds[id];
		
    	t1=(TextView)findViewById(R.id.tv3);
    	t2=(TextView)findViewById(R.id.tv6);
    	t3=(TextView)findViewById(R.id.tv9);
    	t4=(TextView)findViewById(R.id.tv12);
    	t5=(TextView)findViewById(R.id.tv15);
    	
        if (model.equals("Tavera")) {
        	imageView.setVisibility(View.VISIBLE);
			imageView.setImageResource(R.drawable.taverab);
		} else if (model.equals("Innova")) {
			imageView.setVisibility(View.VISIBLE);
			imageView.setImageResource(R.drawable.innovab);
		} else if (model.equals("U-VA")) {
			imageView.setVisibility(View.VISIBLE);
			imageView.setImageResource(R.drawable.uvab);
		} else if (model.equals("Bolero")) {
			imageView.setVisibility(View.VISIBLE);
			imageView.setImageResource(R.drawable.bolerob);
		}
		 else if (model.equals("Alto")){
			imageView.setImageResource(R.drawable.altob);
		}
		 else if (model.equals("Swift")){
			 imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.swiftb);
			}
		 else if (model.equals("Sumo")){
			 imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.sumob);
			}
		 else if (model.equals("Verna")){
				imageView.setImageResource(R.drawable.vernab);
			}
		 else if (model.equals("Winger")){
			 imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.wingerb);
			}
		 else if (model.equals("Xylo")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.xylob);
			}
		 else if (model.equals("Indica")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.indicab);
			}
		 else if (model.equals("Figo")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.figob);
			}
		 else if (model.equals("Eicher")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.eicherb);
			}
		 else if (model.equals("Micra")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.micrab);
			}
		 else if (model.equals("i10")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.i10sb);
			}
		 else if (model.equals("Tata")){
			 
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.tatab);
			}
		 else if (model.equals("Mazda")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.mazdab);
			}
		 else if (model.equals("Jetta")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.jettab);
			}
		 else if (model.equals("Sunny")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.sunnyb);
			}
		 else if (model.equals("Jeep")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.jeepb);
			}
		 else if (model.equals("Eeco")){
				imageView.setImageResource(R.drawable.eecob);
			}
		 else if (model.equals("Ertiga")){
			 
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.ertigab);
			}
		 else if (model.equals("Ashok Leyland")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.asoksb);
			}
		 else if (model.equals("Accent")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.accentb);
			}
		 else if (model.equals("Accord")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.accordb);
			}
		 else if (model.equals("Altis")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.altisb);
			}
     
		 else if (model.equals("Amaze")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.amazeb);
			}
		 else if (model.equals("Aria")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.ariab);
			}
     
		 else if (model.equals("Astar")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.astarb);
			}
     
		 else if (model.equals("Audi")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.audib);
			}
     
		 else if (model.equals("Beat")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.beatb);
			}
     
		 else if (model.equals("Beetle")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.beetleb);
			}
     
		 else if (model.equals("BMW")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.bmwb);
			}
		 else if (model.equals("Brio")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.briob);
			}
		 else if (model.equals("City")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.cityb);
			}
		 else if (model.equals("Civic")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.civicb);
			}
		 else if (model.equals("Enjoy")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.enjoyb);
			}
     
		 else if (model.equals("Estilo")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.estilob);
			}
		 else if (model.equals("Etios")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.etiosb);
			}
     
		 else if (model.equals("Fiesta")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.fiestab);
			}
		 else if (model.equals("Fortuner")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.fortunerb);
			}
     
		 else if (model.equals("Lancer")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.lancerb);
			}

		 else if (model.equals("800")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.m800b);
			}

		 else if (model.equals("Nano")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.nanob);
			}

		 else if (model.equals("Omini")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.omnib);
			}
		 else if (model.equals("Ritz")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.ritzb);
			}
		 else if (model.equals("Spark")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.sparkb);
			}
		 else if (model.equals("Wagon r")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.wagonrb);
			}
		 else if (model.equals("Santro")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.santrob);
			}
		 else if (model.equals("Ambassador")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.ambassb);
			}
		 else if (model.equals("Scorpio")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.scorpiob);
			}
		 else if (model.equals("Camry")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.camryb);
			}
		 else if (model.equals("Captiva")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.captivab);
			}

		 else if (model.equals("Cooper")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.cooperb);
			}
     
		 else if (model.equals("Cruze")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.cruzeb);
			}
		 else if (model.equals("Duster")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.dusterb);
			}
     
		 else if (model.equals("E20")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.e20b);
			}
     
		 else if (model.equals("Elantra")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.elantrab);
			}
     
		 else if (model.equals("Endeavour")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.endeavourb);
			}
		 else if (model.equals("Eon")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.eonb);
			}
		 else if (model.equals("Gypsy")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.gypsyb);
			}
     
		 else if (model.equals("Jazz")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.jazzb);
			}
		 else if (model.equals("Kizashib")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.kizashib);
			}
		 else if (model.equals("Land Cruiser")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.landcrsrb);
			}
		 else if (model.equals("Pajero")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.pajerob);
			}
		 else if (model.equals("Phaeton")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.phaetonb);
			}
		 else if (model.equals("Polo")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.polob);
			}
		 else if (model.equals("Prius")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.priusb);
			}
		 else if (model.equals("Qualis")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.qualisb);
			}
		 else if (model.equals("Safari")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.safarib);
			}
		 else if (model.equals("Sail")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.sailb);
			}
		 else if (model.equals("Skodalaura")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.skodalaurab);
			}
		 else if (model.equals("Sonata")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.sonatab);
			}
     
		 else if (model.equals("SX4")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.sx4b);
			}
     
		 else if (model.equals("Teana")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.teanab);
			}
		 else if (model.equals("Thar")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.tharb);
			}
		 else if (model.equals("Toureg")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.touregb);
			}
		 else if (model.equals("Vento")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.ventob);
			}
		 else if (model.equals("Venture")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.ventureb);
			}
     
		 else if (model.equals("Verito")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.veritob);
			}
		 else if (model.equals("Xenon")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.xenonb);
			}
		 else if (model.equals("XUV")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.xuvb);
			}
		 else if (model.equals("Manza")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.manzab);
			}
		 else if (model.equals("i20")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.i20b);
			}
		 else if (model.equals("Passet")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.passb);
			}
		 else if (model.equals("Fiat")){
			    imageView.setVisibility(View.VISIBLE);
				imageView.setImageResource(R.drawable.fiatb);
			}
     
  
		 else
		 {
			 
			 tableLayout.setPadding(20,10, 0, 0);
		 }
    	
    	 t1.setText(String.valueOf(vid));
    	 t2.setText(reg);
    	 t3.setText(model);
//    	 t4.setText(yom);
    	 t5.setText(make);
    
	}

}
